<template>
  <div class="w-full pb-80px text-14px" v-if="Info.data.length > 0">
    <div class="p-20px bg-white border-b" v-for="item in Info.data">
      <div class="flex w-full justify-between items-center">
        <div>{{ item.memo }}</div>
        <div class="text-[#0CB031]">+{{ item.price }}</div>
      </div>
      <div class="mt-15px flex w-full justify-between items-center">
        <div>{{ item.create_time }}</div>
        <div>余额：{{ item.yprice }}</div>
      </div>
    </div>
  </div>
  <div v-else class="mt-200px">
    <nodata></nodata>
  </div>
  <pagination
    @back="back"
    @next="next"
    :current_page="Info.current_page"
    :last_page="Info.last_page"
    :per_page="Info.per_page"
    :total="Info.total"
  ></pagination>
</template>
<script setup>
import pagination from "@/components/pagination.vue";
import nodata from "@/components/nodata.vue";
import { finance } from "@/util/api";
import { reactive } from "vue";
const Info = reactive({
  current_page: 0,
  last_page: 0,
  per_page: 0,
  total: 0,
  data: [],
});
const param = reactive({
  page: 1,
  type: 1,
});
const page = ref(1);
const getData = async () => {
  const res = await finance(param);
  for (let i in Info) {
    Info[i] = res.msg[i];
  }
  // console.log(Info);
};
getData();
const back = () => {
  param.page--;
  getData();
};
const next = () => {
  param.page++;
  getData();
};
</script>
